<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>本文件用于演示html元素浮动效果（2）</title>
		<style>
			div{
				 
				float: left;
				color: #ADFF2F;
			}
			#div1 {
				background-color: #8B0000;
				
				/* margin-left: 20px; */
			}
			#div2 {
				
				background-color: #006400;
				float: right;
				/* margin-left: 10px; */
			}
			#div3{
				background-color: blue;
				/* 遮盖的优先级。仍然为 */
				/* margin-left: -30px; */
				/* margin-left: 50px; */
	             
			}
			#div4{
				height: 100px;
				width: 100px;
 				background-color: gray;
				float: right;
			}
			#div5{
				background-color: #8A2BE2;
				float: none;
			}
			br{ float: left;}
			img {
				height: 100px;
				/*把行内元素或行内块元素设为块元素之后。可以避免底部莫名增加的边距*/
				display: block;
			}
		</style>
	</head>
	<body>
		<div id="div1">
			<img src="../2.jpg" />
		</div>
		
		<div id="div2">
			<img src="../20190228/0.jpg" />
		</div>
		<div id="div3">
			<img src="../20190228/imgs/1.jpg" />
		</div>
		<div id="div4">
			
		</div>
		
		<!--div4若不是浮动。则会被前面的浮动div影响。若要脱离影响需要使用clear属性-->
		<!-- <br clear="all" />
		<div id="div4">
			<img src="../20190228/imgs/4.jpg" />
			<input type="button" value="234" />
			<input type="button" value="234" />
			<p>asdfasdf</p>
		</div>
		<br clear="all" />
		<div id="div5">
			<img src="../20190228/imgs/5.jpg" />
			<input type="button" value="333333" />
			<input type="button" value="444444" />
			<p>5555555</p>
		</div> -->
	</body>
</html>
